<?php
/**
 * The main template file.
 *
 * Bạn đang sử dụng template được xây dựng bởi cống ty TNHH Quả Anh Đào
 * 
 * 
 * 
 * Learn more: http://quaanhdao.vn
 * @package DoanhnghiepWeb500K
 * @subpackage web500k
 * @since 2012
 */
get_header(); ?>
<div class="cy-content">
	<?php //sssget_sidebar();?>
    
    <div class="cy-index-left">
    <div>
        <div class="news-icon"><img src="<?php bloginfo("template_directory"); ?>/_img/news-icon.jpg" /></div>
        <div class="titleblue"><span class="active-news">Tin tức mới nhất</span><a href="<?php the_permalink(); ?>"><span class="readmore"></span></a></div>
    </div>
    
    <ul class="clearfix">
    <?php
    $loop = new WP_Query(array('post_type'=>'news','posts_per_page'=>10,'order'=>'DESC'));?>
    <?php while ( $loop->have_posts() ) : $loop->the_post(); //bat dau vong lap ?>
    <li><a href="<?php the_permalink()?>"><?php the_title();?></a>
    <?php
    if(get('hot')==true){
    ?>
    <span class="hotnews">
    <?php }else if(get_the_date('d')==date('d')){
        echo "<span class='cy-new'></span>";  
    }else{ echo "";} ?>
    </span></li>
    <?php endwhile; //ket thuc vong lap ?>
    <?php wp_reset_query();?>
    </ul>
    </div><!--cy-index-left-->
    
    <div class="cy-index-right">
     <h2><ul><li>Sản phẩm tiêu biểu</li></ul></h2>
    <ul id="tab_product" class="tab_product">
    
     <?php
    $i=1;
    $loop = new WP_Query(array('post_type'=>'san_pham','posts_per_page'=>100,'order'=>'DESC'));?>
    <?php while ( $loop->have_posts() ) : $loop->the_post(); //bat dau vong lap ?>
        <?php if($i <=5){?>
			<li <?php if($i==1){ 
			 echo "class='active tab_product-1'";
            }else{?> class="tab_product-<?php echo $i;?>"
            <?php }?>
            >
            <a href="#check-product-<?php echo $i;?>" ><?php echo $i;?></a></li>
            
     <?php 
     $i ++;
     }
     endwhile; //ket thuc vong lap ?>
    <?php wp_reset_query();?>
    
		</ul>
        
    <?php
    $j=1;
     $loop = new WP_Query(array('post_type'=>'san_pham','posts_per_page'=>100,'order'=>'DESC'));?>
    <?php while ( $loop->have_posts() ) : $loop->the_post(); //bat dau vong lap ?>
      <?php if($j <=5){?>
		<div id="check-product-<?php echo $j;?>" class="content">
				<a href="<?php the_permalink();?>"><img src="<?php echo get('hinh');?>"/></a>
                <a href="<?php the_permalink();?>"><span><?php the_title();?></span></a>
		</div>
  <?php 
     $j ++;
     }
     endwhile; //ket thuc vong lap ?>
    <?php wp_reset_query();?>
		
    
    </div><!--cy-index-right-->
    <img src="<?php bloginfo('template_directory');?>/_img/index_06.jpg" />
</div><!--cy-content-->
<?php get_footer(); ?>